<template>
  <div class="page">
    <!-- 导航 开始 -->
    <nav-bar title="医院列表"></nav-bar>
    <!-- 导航 end -->

    <!-- 医院列表 开始 -->
    <div class="list_box">
      <HospitalTwo
        v-for="(item, index) in hospitalList"
        :key="index"
        :info="item"
      ></HospitalTwo>
    </div>
    <!-- 医院列表 end -->
  </div>
</template>
<script>
import HospitalTwo from "@/components/hospital/hospital_two.vue";
import { GET_GOODS_HOSPITALS } from "@/http/interface";
export default {
  components: {
    HospitalTwo,
  },
  data() {
    return {
      hospitalList: [],
    };
  },
  head() {
    return {
      link: [{ ref: "canonical", href: `${this.$domain}/goods/hospital` }],
    };
  },
  async asyncData({ query, $axios }) {
    let params = { id: query.id };
    let res = await $axios.get(GET_GOODS_HOSPITALS, { params: params });
    let hospitalList = res.data || [];
    return {
      hospitalList,
    };
  },
};
</script>
<style lang="less" scoped>
@import "/assets/styles/goods/hospital.less";
</style>